// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)
let qiniuToken = '/resource/app/oss/token'; //获取七牛云相关的有些配置
let SendCode = '/system/app/common/send_code/v2'; //发送短信验证码
let Login = '/auth/app/login'; //登录
let SetPassword = '/user/app/user_info/phone/set_password'; //设置密码
let BannerList = '/tenant/app/tenant_banner/list'; // 广告轮播图列表
let MyHome = '/user/app/user_info/my/home'; //获取首屏我的详情
let ResetPassword = '/user/app/user_info/phone/reset_password'; //手机号重设密码
let RegisterTotal = '/user/app/user_info/register_total'; //注册人数
let ProductSearch = '/product/app/product_spu/search'; //条件查询spu列表
let ProductDetail = '/product/app/product_spu/detail'; //获取商品详情
let MyInfo = '/user/app/user_info/my/info'; //获取用户详细信息
let RealName = '/user/app/user_real_name_apply/auth'; //实名认证
let MyList = '/order/app/order_info/my/list'; // 查询订单列表
let Qrcode = '/system/app/common/qrcode'; //生成二维码
let CollectionList = '/nft/app/nft_collection/list'; //我的藏品列表
let CollectionTags = '/nft/app/nft_collection/tags'; //我的藏品tag+数量
let CollectionInfo = '/nft/app/nft_collection/info'; //获取藏品详情
let Pay = '/order/app/order_info/pay/jiuge'; //订单支付
let EditInfo = '/user/app/user_info/my/edit'; //编辑信息
let Base = '/system/app/config/base'; //获取应用基础配置
let OrderSubmit = '/order/app/order_info/submit'; //订单提交
let OrderConfirm = '/order/app/order_info/confirm'; //订单确认
let OrderSeckill = '/order/app/order_info/seckill'; //订单抢购
let OrderDetail = '/order/app/order_info/detail'; //查询订单详情\
let ProductRedeem = '/product/app/product_collection_code/redeem'; //兑换藏品
let OpenBindBox = '/nft/app/nft_collection/open_blind_box'; //开启盲盒

let Signing = '/wallet/app/quick/pay/signing'; //是否已签约
let AgreeApply = '/app/q_pay/agree_apply'; //协议申请
let SignInfo = '/user/app/user_sign_log/sign_info'; //查询用户签到对象
let SignPrizeList = '/user/app/user_sign_prize/list'; //签到额外奖品列表
let SignLog = '/user/app/user_sign_log/sign'; //签到打卡
let TaskList = '/user/app/user_task/list'; //获取任务对象列表
let SignCoinsLog = '/wallet/app/wallet/sign_coins/log'; //灵石明细
let MallProductList = '/product/app/product_Integral_mall/list'; //查询积分商城列表
let MyWallet = '/wallet/app/wallet/my'; //获取我的钱包信息
let SigningApply = '/wallet/app/quick/pay/signing/apply'; //汇聚支付
let SigningConfirm = '/wallet/app/quick/pay/signing/confirm'; //汇聚协议申请确认
let QuickPay = '/wallet/app/quick/pay/quick/pay'; //汇聚快捷支付
let PaySigningList = '/wallet/app/quick/pay/signingList'; //查询用户已签约银行列表
let MallPurchase = '/product/app/product_Integral_mall/purchase'; //积分兑换商品
let ProductEggCount = '/product/app/product_twisted_egg/count'; //获取扭蛋剩余次数
let ProductEggAdvertising = '/product/app/product_twisted_egg/advertising'; //获取扭蛋机广告
let ProductEggExchange = '/product/app/product_twisted_egg/integral/exchange'; //积分兑换次数
let ProductEgg = '/product/app/product_twisted_egg'; //扭蛋
let ExchangePrice = '/product/app/product_twisted_egg/integral/exchange/price'; //获取扭蛋价格

let ProductBrand = '/product/app/product_brand/page'; //查询品牌馆列表
let ProductBrandSpu = '/product/app/product_brand/info/spu_page'; //查询品牌馆详情的商品列表
let ProductBrandInfo = '/product/app/product_brand/info'; //查询品牌馆详情
let TenantBanner = '/tenant/app/tenant_banner/list'; //查询品牌馆轮播图列表
let ProductBrandFocus = '/product/app/product_brand/focus'; //关注
let ProductBrandIsFocus = '/product/app/product_brand/is_focus'; //是否关注

let CollectionPage = '/user/app/user_collection_info/page'; //逛逛展列表
let BySkuId = '/nft/app/nft_collection/list/by_sku_id'; //根据skuid获取我的所有该商品的编号
let ProductSyntheticMaterial = '/product/app/product_synthetic_material'; //合成方法
let CollectionGiving = '/nft/app/nft_collection/giving'; //转赠藏品
let CollectionCreate = '/user/app/user_collection_info/create'; //创建藏馆
let CollectionInfoAggr = '/user/app/user_collection_info/aggr'; //获取个人藏馆详情
let CollectionRandom = '/user/app/user_collection_info/random'; //逛一逛，随机展馆
let CollectionInfoLike = '/user/app/user_collection_info/like'; //点赞/取消点赞
let CollectionThemeList = '/user/app/user_collection_info/theme/list'; //获取主题列表
let Code = '/code'; //获取图片验证码

let InviteDetail = '/user/app/user_activity/invite/detail'; //邀请明细
let ActivityInfo = '/user/app/user_activity/info'; //当前活动详情
let RankingMy = '/user/app/user_activity/ranking/my'; //我的排名
let Ranking = '/user/app/user_activity/ranking'; //活动排行榜

let MarketingList = '/marketing/marketing_priority/app/list'; //查询我的优先购列表
let PayInfoStatus = '/wallet/app/quick/pay/info/status'; //查询快捷支付订单状态

let DrawLots = '/marketing/app/marketing_draw_lots/drawLots'; //抽签
let OrderGen = '/order/app/order_info/hash_order_gen'; //查询是否有订单生成
let CollectionInfoUpdate = '/user/app/user_collection_info/update'; //编辑个人藏馆
let CollectionInfoAggrMy = '/user/app/user_collection_info/aggr/my'; //获取个人藏馆详细信息
let CollectionPlace = '/nft/app/nft_collection/place'; //可放置藏品列表
let CollectionInfoPlace = '/user/app/user_collection_info/place'; //放置藏品
let CollectionInfoTheme = '/user/app/user_collection_info/theme'; //选择主题

let CouponMyList = '/marketing/app/marketing_coupon/my/list'; //获取优惠券列表
let CreatorProduction = '/product/app/product_brand/creator/production'; //创作者作品
let CreatorInfo = '/product/app/product_brand/creator/info'; //创作者详情
let CollectionUnlock = '/user/app/user_collection_info/unlock'; //解锁展位

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {

	/** 获取七牛云token */
	const getQiniuToken = (params = {}) => vm.$u.get(qiniuToken, params);

	/** 发送短信验证码 */
	const onSendCode = (params = {}, data) => vm.$u.post(SendCode, params);

	/** 登录 */
	const onLogin = (params = {}, id) => vm.$u.post(`${Login}?akcCode=${id}`, params);

	/** 设置密码 */
	const onSetPassword = (params = {}) => vm.$u.post(SetPassword, params);

	/** 获取轮播图 */
	const getBannerList = (params = {}) => vm.$u.get(BannerList, params);

	/** 获取我的首屏详情 */
	const getMyHome = (params = {}) => vm.$u.get(MyHome, params);

	/** 手机号重设密码 */
	const onResetPassword = (params = {}) => vm.$u.post(ResetPassword, params);

	/** 注册人数 */
	const onRegisterTotal = (params = {}) => vm.$u.get(RegisterTotal, params);

	/** 条件查询spu列表 */
	const getProductSearch = (params = {}) => vm.$u.get(ProductSearch, params);

	/** 获取商品详情 */
	const getProductDetail = (params = {}, id) => vm.$u.get(`${ProductDetail}/${id}`, params);

	/** 获取我的详细信息 */
	const getMyInfo = (params = {}) => vm.$u.get(MyInfo, params);

	/** 身份验证 */
	const onRealName = (params = {}) => vm.$u.post(RealName, params);

	/** 查询订单列表 */
	const getMyList = (params = {}) => vm.$u.get(MyList, params);

	/** 生成二维码 */
	const getQrcode = (params = {}) => vm.$u.get(Qrcode, params);

	/** 我的藏品列表 */
	const getCollectionList = (params = {}) => vm.$u.get(CollectionList, params);

	/** 获取我的藏品+数量 */
	const getCollectionTags = (params = {}) => vm.$u.get(CollectionTags, params);

	/** 获取我的藏品详情 */
	const getCollectionInfo = (params = {}, id) => vm.$u.get(`${CollectionInfo}?collectionId=${id}`, params);

	/** 支付 */
	const onPay = (params = {}, id, skuId) => vm.$u.post(`${Pay}/${id}?skuId=${skuId}`, params);

	/** 修改个人信息 */
	const onEditInfo = (params = {}) => vm.$u.put(EditInfo, params);

	/** 获取应用配置 */
	const getBase = (params = {}) => vm.$u.get(Base, params);

	/** 订单提交 */
	const onOrderSubmit = (params = {}) => vm.$u.post(OrderSubmit, params);

	/** 订单确认 */
	const onOrderConfirm = (params = {}) => vm.$u.post(OrderConfirm, params);

	/** 订单抢购 */
	const onOrderSeckill = (params = {}) => vm.$u.post(OrderSeckill, params);

	/** 订单详情 */
	const getOrderDetail = (params = {}, id) => vm.$u.get(`${OrderDetail}/${id}`, params);

	/** 兑换藏品 */
	const onProductRedeem = (params = {}, id) => vm.$u.post(`${ProductRedeem}?code=${id}`, params);

	/** 开启盲盒 */
	const onOpenBindBox = (params = {}, id) => vm.$u.post(`${OpenBindBox}/${id}`, params);

	/** 是否已签约 */
	const onSigning = (params = {}) => vm.$u.get(Signing, params);

	/** 协议申请 */
	const onAgreeApply = (params = {}) => vm.$u.post(AgreeApply, params);

	/** 查询用户签到对象 */
	const getSignInfo = (params = {}) => vm.$u.get(SignInfo, params);

	/** 签到额外奖品列表 */
	const getSignPrizeList = (params = {}) => vm.$u.post(SignPrizeList, params);

	/** 签到打卡 */
	const onSignLog = (params = {}) => vm.$u.post(SignLog, params);

	/** 获取任务对象列表 */
	const getTaskList = (params = {}) => vm.$u.get(TaskList, params);

	/** 灵石积分明细 */
	const getSignCoinsLog = (params = {}) => vm.$u.get(SignCoinsLog, params);

	/** 查询积分商城列表 */
	const getMallProductList = (params = {}) => vm.$u.get(MallProductList, params);

	/** 获取我的钱包信息 */
	const getMyWallet = (params = {}) => vm.$u.get(MyWallet, params);

	/** 汇聚支付 */
	const onSigningApply = (params = {}) => vm.$u.post(SigningApply, params);

	/** 汇聚确认协议 */
	const onSigningConfirm = (params = {}) => vm.$u.get(SigningConfirm, params);

	/** 汇聚快捷支付 */
	const onQuickPay = (params = {}) => vm.$u.post(QuickPay, params);

	/** 获取该用户已签约列表 */
	const getPaySigningList = (params = {}) => vm.$u.get(PaySigningList, params);

	/** 积分兑换商品 */
	const onMallPurchase = (params = {}, data) => vm.$u.post(
		`${MallPurchase}?goodsId=${data.goodsId}&&count=${data.count}`, params);

	/** 获取扭蛋剩余次数 */
	const getProductEggCount = (params = {}, id) => vm.$u.get(`${ProductEggCount}/${id}`, params);

	/** 广告 */
	const getProductEggAdvertising = (params = {}, id) => vm.$u.get(`${ProductEggAdvertising}?skuId=${id}`, params);

	/** 扭蛋：积分兑换次数 */
	const onProductEggExchange = (params = {}) => vm.$u.get(ProductEggExchange, params);

	/** 扭蛋 */
	const onProductEgg = (params = {}, id) => vm.$u.post(`${ProductEgg}/${id}`, params);

	/** 查询品牌馆聚合列表 */
	const getProductBrand = (params = {}) => vm.$u.get(ProductBrand, params);

	/** 查询品牌馆详情的商品列表 */
	const getProductBrandSpu = (params = {}, id) => vm.$u.get(`${ProductBrandSpu}/${id}`, params);

	/** 查询品牌馆详情 */
	const getProductBrandInfo = (params = {}, id) => vm.$u.get(`${ProductBrandInfo}/${id}`, params);

	/** 查询品牌馆轮播图列表 */
	const getTenantBanner = (params = {}) => vm.$u.get(TenantBanner, params);

	/** 关注/取消关注 */
	const onProductBrandFocus = (params = {}, id) => vm.$u.get(`${ProductBrandFocus}/${id}`, params);

	/** 是否关注 */
	const getProductBrandIsFocus = (params = {}, id) => vm.$u.get(`${ProductBrandIsFocus}/${id}`, params);

	/** 个人藏馆列表 */
	const getCollectionPage = (params = {}, data) => vm.$u.get(CollectionPage, params);

	/** 根据skuid获取所有该商品的编号 */
	const getBySkuId = (params = {}, id) => vm.$u.get(`${BySkuId}?skuId=${id}`, params);

	/** 合成方法 */
	const onProductSyntheticMaterial = (params = {}, id) => vm.$u.post(`${ProductSyntheticMaterial}/${id}`, params);

	/** 获取扭蛋价格 */
	const getExchangePrice = (params = {}, id) => vm.$u.get(`${ExchangePrice}?skuId=${id}`, params);

	/** 藏品转赠 */
	const onCollectionGiving = (params = {}) => vm.$u.post(CollectionGiving, params);

	/** 创建藏馆 */
	const onCollectionCreate = (params = {}) => vm.$u.post(CollectionCreate, params);

	/** 获取个人藏馆详情 */
	const getCollectionInfoAggr = (params = {}, id) => vm.$u.get(`${CollectionInfoAggr}/${id}`, params);

	/** 逛一逛，随机藏馆 */
	const onCollectionRandom = (params = {}) => vm.$u.get(CollectionRandom, params);

	/** 点赞/取消点赞 */
	const onCollectionInfoLike = (params = {}, id) => vm.$u.get(`${CollectionInfoLike}/${id}`, params);

	/** 获取主题列表 */
	const getCollectionThemeList = (params = {}) => vm.$u.get(CollectionThemeList, params);

	/** 获取图片验证码 */
	const getCode = (params = {}) => vm.$u.get(Code, params);

	/** 邀请明细 */
	const getInviteDetail = (params = {}, id, data) => vm.$u.get(`${InviteDetail}?activityId=${id}`, params);

	/** 当前活动详情 */
	const getActivityInfo = (params = {}) => vm.$u.get(ActivityInfo, params);

	/** 我的排名 */
	const getRankingMy = (params = {}, id) => vm.$u.get(`${RankingMy}/${id}`, params);

	/** 活动排行榜 */
	const getRanking = (params = {}, id, data) => vm.$u.get(`${Ranking}/${id}`, params);

	/** 查询我的优先购列表 */
	const getMarketingList = (params = {}) => vm.$u.get(MarketingList, params);

	/** 查询快捷支付订单状态 */
	const getPayInfoStatus = (params = {}, id) => vm.$u.get(`${PayInfoStatus}/${id}`, params);

	/** 用户抽签 */
	const OnDrawLots = (params = {}, id) => vm.$u.post(`${DrawLots}/${id}`, params);

	/** 查询是否有订单生成 */
	const getOrderGen = (params = {}) => vm.$u.post(OrderGen, params);

	/** 编辑个人藏馆 */
	const onCollectionInfoUpdate = (params = {}) => vm.$u.post(CollectionInfoUpdate, params);

	/** 获取个人藏馆详细信息 */
	const getCollectionInfoAggrMy = (params = {}) => vm.$u.get(CollectionInfoAggrMy, params);

	/** 获取可放置列表 */
	const getCollectionPlace = (params = {}, id) => vm.$u.get(`${CollectionPlace}/${id}`, params);

	/** 放置藏品 */
	const onCollectionInfoPlace = (params = {}, id) => vm.$u.post(CollectionInfoPlace, params);

	/** 选择主题 */
	const onCollectionInfoTheme = (params = {}, id) => vm.$u.get(`${CollectionInfoTheme}/${id}`, params);

	/** 获取我的优惠券列表 */
	const getCouponMyList = (params = {}) => vm.$u.get(CouponMyList, params);

	/** 获取创作者作品 */
	const getCreatorProduction = (params = {}, id) => vm.$u.get(`${CreatorProduction}/${id}`, params);

	/** 获取创作者详情 */
	const getCreatorInfo = (params = {}, id) => vm.$u.get(`${CreatorInfo}/${id}`, params);

	/** 解锁展位 */
	const onCollectionUnlock = (params = {}, data) => vm.$u.post(
		`${CollectionUnlock}/${data.pavilionId}?amount=${data.amount}`);


	/** 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下 */
	vm.$u.api = {
		getQiniuToken,
		onSendCode,
		onLogin,
		onSetPassword,
		getBannerList,
		getMyHome,
		onResetPassword,
		onRegisterTotal,
		getProductSearch,
		getProductDetail,
		getMyInfo,
		onRealName,
		getMyList,
		getQrcode,
		getCollectionList,
		getCollectionTags,
		getCollectionInfo,
		onPay,
		onEditInfo,
		getBase,
		onOrderSubmit,
		onOrderConfirm,
		onOrderSeckill,
		getOrderDetail,
		onProductRedeem,
		onOpenBindBox,

		onSigning,
		onAgreeApply,
		getSignInfo,
		getSignPrizeList,
		onSignLog,
		getTaskList,
		getSignCoinsLog,
		getMallProductList,
		getMyWallet,
		onSigningApply,
		onSigningConfirm,
		onQuickPay,
		getPaySigningList,
		onMallPurchase,
		getProductEggCount,
		getProductEggAdvertising,
		onProductEggExchange,
		onProductEgg,
		getExchangePrice,

		getProductBrand,
		getProductBrandSpu,
		getTenantBanner,
		getProductBrandInfo,
		onProductBrandFocus,
		getProductBrandIsFocus,

		getCollectionPage,
		getBySkuId,
		onProductSyntheticMaterial,
		onCollectionGiving,
		onCollectionCreate,
		getCollectionInfoAggr,
		onCollectionRandom,
		onCollectionInfoLike,
		getCollectionThemeList,
		getCode,

		getInviteDetail,
		getActivityInfo,
		getRankingMy,
		getRanking,

		getMarketingList,
		getPayInfoStatus,
		OnDrawLots,
		getOrderGen,
		onCollectionInfoUpdate,
		getCollectionInfoAggrMy,
		getCollectionPlace,
		onCollectionInfoPlace,
		onCollectionInfoTheme,
		getCouponMyList,
		getCreatorProduction,
		getCreatorInfo,
		onCollectionUnlock,
	};
}

export default {
	install
}
